import request from "@/utils/request"

const url = '/qQuestion'

// 获取热门问答数据
export function getHotQAAPI() {
    return request({
        url: `${url}/hot`
    })
}

// 发布提问
export function pushQuestionAPI({ content, expert, expertId, phone, plant }) {
    return request({
        url: `${url}/publish`,
        method: 'POST',
        data: {
            content,
            expert,
            expertId,
            phone,
            plant
        }
    })
}

// 获取个人的提问
export function getOwnQuestionAPI() {
    return request({
        url: `${url}/user`
    })
}

// 获取专家的提问
export function getExpertQuestionAPI(id) {
    return request({
        url: `${url}/expert/${id}`
    })
}

// 根据id删除提问
export function delQuestionAPI(id) {
    return request({
        url: `${url}/${id}`,
        method: 'DELETE'
    })
}